<template>
<p>一个二维码</p>
 <div class="qrcode" ref="qrCodeUrl"></div>
</template>

<script>
 import VueQr from 'vue-qr'
// import HelloWorld from './components/HelloWorld.vue'
import QRCode from 'qrcodejs2'

export default {
  name: 'qrcode',
  components: {
    // HelloWorld,
      VueQr
  },
  data() {
      return {

}
    },
methods: {
    creatQrCode() {
        var qrcode =new QRCode(this.$refs.qrCodeUrl, {
            text:'https://www.yunliyunwai.cn/',// 需要转换为二维码的内容
            width: 100,
            height: 100,
            colorDark:'#000000',
            colorLight:'#ffffff',
            correctLevel: QRCode.CorrectLevel.H
        })
    },
},
mounted() {
    this.creatQrCode();
},
}
</script>

<style>
 
#center{
position: relative;
left:-380px;
top:-150px;
transform: scale(0.2);
}
 
</style>
